package com.DHH.Service.Identity.Impl;
import com.DHH.Entity.Identity.IdentityAuthentication;
import com.DHH.Mapper.Identity.IdentityAuthenticationMapper;
import com.DHH.Service.Identity.IIdentityAuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IdentityAuthenticationServiceImpl implements IIdentityAuthenticationService{
	
	@Autowired
    private IdentityAuthenticationMapper identityAuthenticationMapper;
    
   @Override
   public IdentityAuthentication insertIdentityAuthentication(IdentityAuthentication identityAuthentication){
	   
        identityAuthenticationMapper.insertSelective(identityAuthentication);
	   return identityAuthentication;
	   
   };
   @Override
   public IdentityAuthentication updateIdentityAuthentication(IdentityAuthentication identityAuthentication){
	     identityAuthenticationMapper.updateByPrimaryKeySelective(identityAuthentication);
        return identityAuthentication;
   };
   @Override
   public IdentityAuthentication deleteIdentityAuthentication(IdentityAuthentication identityAuthentication){

	     identityAuthenticationMapper.delete(identityAuthentication);
        return identityAuthentication;
   };
    /**
     * 保存或更新操作，返回值为主表
     */
    public IdentityAuthentication saveOrUpdateIdentityAuthentication(IdentityAuthentication identityAuthentication){
        if(identityAuthentication.getId()==null)
        {
            identityAuthenticationMapper.insertSelective(identityAuthentication);
        }else{
            identityAuthenticationMapper.updateByPrimaryKeySelective(identityAuthentication);
        }
        return identityAuthentication;
    };
}
